<?php

use CtyunOss\CtyunOss;
use Symfony\Component\VarDumper\VarDumper;

require_once '../config.php';
require_once EXAMPLE_PATH . '../vendor/autoload.php';

$config->debug = true;

$time = time();

$file = new SplFileInfo('../file/test.txt');

$f = fopen($file->getRealPath(), 'r+');
fgets($f);
fwrite($f, $time);
fclose($f);
unset($f);

$oss  = new CtyunOss($config);
$bool = $oss->bucket()->putObject('/test-' . $time . '.txt', $file, false);
VarDumper::dump($bool);